import { getmAbnormal } from '@/services/warning';

export default {
  namespace: 'mscore',

  state: {
    mScoreData: {},
  },

  effects: {
    *getmScoreData({ payload }, { call, put }) {
      try {
        const response = yield call(getmAbnormal, payload);
        yield put({
          type: 'setmScoreData',
          payload: {
            mScoreData: response,
          },
        });
      } catch (e) {
        console.log('Error:', e);
      }
    },
  },
  reducers: {
    setmScoreData(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
